package factories;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class EasyKeyScrollListener implements ActionListener{

	MapRenderer r;
	TestRenderer tr;
	
	public EasyKeyScrollListener(MapRenderer r, TestRenderer tr){
		this.r = r;
		this.tr = tr;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		char c = tr.getDirection();
		switch(c){
		case 'z' : r.shiftTop(); break;
		case 's' : r.shiftBottom(); break;
		case 'q' : r.shiftLeft(); break;
		case 'd' : r.shiftRight(); break;
		case 'w' : r.shiftTop(); break;
		case 'a' : r.shiftLeft(); break;
	}
	}

}
